import request from '@/utils/request';
import type { successMsg, UserItem, Userpages } from '@/views/users/dto/get-user.dto';

// 获取用户详细信息列表
export const getUserListService = (userpages?: Userpages) => request.get('/user', { params: userpages }) as Promise<UserItem[]>
// 添加用户
export const addUserService = (data: UserItem) => request.post('/user', data)
// 修改用户信息
// 这里的headers的AUthorization对应的是它的id,应付一下
export const editUserService = (data: UserItem, id: number) => request.put('user', data, { params: { id } }) as Promise<successMsg>
// 通过id删除用户
export const delUserService = (id: number) => request.delete('/user', { params: { id } }) as Promise<successMsg> 